
// 定义子组件的位置
import {Outlet} from "react-router-dom"
import { Mycontext } from "../../App"
import {useContext} from "react"
function Page1(){
    let [value,setvalue] = useContext(Mycontext)
    return <>
        <div>Page1 --- {JSON.stringify(value)}</div>
        <button onClick={()=>{
            let obj = {...value}
            obj.aaa = 12
            setvalue(obj)
        }}>改变context传过来得双向绑定数据</button>
        <h2>子组件的位置</h2>
        <Outlet></Outlet>
    </>
}

export default Page1